<?php if (!defined('BASEPATH'))exit('No direct script access allowed');
/**
 * 新手指南模块控制器
 */
class Guider extends MY_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model('content_model');
        $this->load->model('cate_model');
        $this->catelist = $this->cate_model->content_cate_list(array('group'=>'guide','hide'=>0));
        $this->catelist = $this->cate_model->tree($this->catelist,  $this->catelist[0]['id']);
        foreach ($this->catelist as $key=>$val){
            $this->catelist[$key]['url'] = site_url('guider/'.$val['id']);
        }
        $this->assign('cate', $this->catelist);
    }
    
    
    //首页
    function index($type) {
        $type = $type ? $type : $this->catelist[0]['id'];
        $item = $this->cate_model->content_cate_get(array("id"=>$type));
        $where = array();
        $where['cate_id'] = $type;
        $where['status'] = 1;
        $list = $this->content_model->getList($where);
        $this->assign('type', $type);
        $this->assign('item', $item);
        $this->assign('list', $list);
        $this->assign('action',$item['code']);
        $this->display('guider/index.html');
    }
}
